package com.cgq.pro.entity;

import java.util.HashMap;
import java.util.Map;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.cgq.base.entity.Base;
import com.cgq.utils.PropertiesUtil;

@Entity
@Table(name="fd_regionstatistics")
public class RegionStatistics extends Base {
	/**序号*/
	private String id;
	/**编号*/
	private String num;
	/**行政分区*/
	private Region regionId;
	/**成交套数*/
	private double cjts;
	/**成交面积*/
	private double cjmj;
	/**成交均价*/
	private double cjjj;
	/**经度*/
	private String lon;
	/**纬度*/
	private String lat;
	/**多边形坐标*/
	private String points;
	/**物业类型*/
	private String type;
	
	public String getType() {
		return type;
	}
	public void setType(String type) {
		this.type = type;
	}
	/**地块类型：1.点状地块 2.块状地块*/
	private String landType;
	/**备注图标名称*/
	private String markerName;
	/**楼盘状态**/
	@Column
	private int p_status;
	
	public int getP_status() {
		return p_status;
	}
	public void setP_status(int p_status) {
		this.p_status = p_status;
	}
	@Column
	public String getLandType() {
		return landType;
	}
	public void setLandType(String landType) {
		this.landType = landType;
	}
	
	@Column
	public String getPoints() {
		return points;
	}
	public void setPoints(String points) {
		this.points = points;
	}
	
	@Id
	@Column(name="id")
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	@Column
	public String getNum() {
		return num;
	}
	public void setNum(String num) {
		this.num = num;
	}
	@ManyToOne
	@JoinColumn(name="regionid")
	public Region getRegionId() {
		return regionId;
	}

	public void setRegionId(Region regionId) {
		this.regionId = regionId;
	}
	
	@Column(name="cjts")
	public double getCjts() {
		return cjts;
	}
	public void setCjts(double cjts) {
		this.cjts = cjts;
	}
	
	@Column(name="cjmj")
	public double getCjmj() {
		return cjmj;
	}
	public void setCjmj(double cjmj) {
		this.cjmj = cjmj;
	}
	
	@Column(name="cjjj")
	public double getCjjj() {
		return cjjj;
	}
	public void setCjjj(double cjjj) {
		this.cjjj = cjjj;
	}
	
	@Column(name="longitude")
	public String getLon() {
		return lon;
	}
	public void setLon(String lon) {
		this.lon = lon;
	}
	
	@Column(name="Latitude")
	public String getLat() {
		return lat;
	}
	public void setLat(String lat) {
		this.lat = lat;
	}
	@Column
	public String getMarkerName() {
		return markerName;
	}
	public void setMarkerName(String markerName) {
		this.markerName = markerName;
	}
	@Override
	public Map<String, Object> toMap() {
		Map<String, Object> map=new HashMap<String, Object>();
		map.put("id", id);
		map.put("num", num);
		map.put("name", name);
		try {
			map.put("type",PropertiesUtil.readByKey("landUseType", "type."+ this.type));
		} catch (Exception e) {
			e.printStackTrace();
		}
		map.put("p_status", PropertiesUtil.getPStatusStr(this.p_status));
		map.put("regionname", regionId.getName());
		map.put("cjts", cjts);
		map.put("cjmj", cjmj);
		map.put("cjjj", cjjj);
		map.put("remark", remark);
		return map;
	}
	
}
